<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchFormDict").submit();
        return false;
    }

    /*库存单位补全*/
    autoCompleteFirm("remarks");
    function autoCompleteFirm(inputId) {
        var url = "${ctx}/drug/drugStorageDept/autoComplete";
        autoComplete(inputId, url,
                function (data) {
                    var rows = [];
                    for (var i = 0; i < data.length; i++) {
                        rows[rows.length] = {
                            data: data[i],
                            value: data[i].id,
                            result: data[i].storageName
                        };
                    }
                    return rows;
                }, function (data, i, max) {
                    return data.storageName;
                }, function (event, data, formatted) {
                    $('#remarks').attr('value', data.id);
                    $('#storageId').attr('value', data.id);
                });
    }

</script>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-4">
            <div class="content-wrap" id="leftCenterDiv">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#">出库单列表</a>
                        </li>
                    </ul>
                    <%--左侧出库单列表--%>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="table-responsive no-border">
                                <div class="datatable-top">
                                    <div class="pull-left">
                                        <%--出库单查询--%>
                                        <form:form id="searchFormDict" modelAttribute="drugExportMaster"
                                                   onsubmit="return loadDivForm('mainCenterDiv','searchFormDict','${ctx}/drug/drugStock/batchImport');"
                                                   method="post" class="form-inline">
                                            <div class="form-group">
                                                <label class=" control-label">供货方：</label>
                                                <form:input path="storageId" id="storageId" hidden="true" />
                                                <form:input path="remarks" id="remarks" htmlEscape="false" class="form-control" maxlength="64" />
                                            </div>
                                            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                        </form:form>
                                    </div>
                                </div>

                                <%--出库单列表--%>
                                <div class="container-fluid">
                                    <table id="contentTable1" class="table table-bordered mg-t datatable">
                                        <thead>
                                        <tr>
                                            <th>单号</th>
                                            <th>来源</th>
                                            <th>出库人</th>
                                            <th>金额</th>
                                            <th>出库时间</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <c:forEach items="${page.list}" var="drugExportMaster">
                                        <tr onclick="loadDiv('rigthCenterDiv','${ctx}/drug/drugDetails/findByMaster?masterId=${drugExportMaster.id}')">
                                            <td>${drugExportMaster.documentNo}</td>
                                            <td>${fns:getDeptName(drugExportMaster.storageId,"")}</td>
                                            <td>${fns:getUserName(drugExportMaster.createBy)}</td>
                                            <td>${drugExportMaster.accountReceivable}</td>
                                            <td><fmt:formatDate value="${drugExportMaster.createDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                        </tr>
                                        </c:forEach>
                                        </tbody>
                                    </table>
                                    <div class="pagination">${page}</div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>

        <%--右侧药品规格字典列表--%>
        <section class="main-content col-lg-8">
            <div class="content-wrap" id="rigthCenterDiv">

            </div>
        </section>
    </section>
</div>

